class ProjectList extends HashMap {

   Project currentProject;
   boolean defaultSetExplicitly = false;
   
   ProjectList() {}
   
   Project addProject(String name) {
     return addProject(new Project(name));
   }
   
   Project addProject(Project p) {
     put(p.shortname, p);
     if (!defaultSetExplicitly || currentProject == null) currentProject = p;
     return p;
   }
   
   void makeDefault(Project p) {
     currentProject = p;
     defaultSetExplicitly = true;
   }
   
}




class Project extends HashMap {

  String shortname;
  Environment currentModel = null;
  Toolbar modelsToolbar = null;
  boolean defaultSetExplicitly = false;
  
  Project(String shortname) {
    this.shortname = shortname;
    currentModel = null;
  }
  
  Environment addModel(Environment env) {
    put(env.shortname, env);
    if (!defaultSetExplicitly || currentModel == null) currentModel = env;
    return env;
  }
  
  void makeDefault(Environment env) {
    currentModel = env;
    defaultSetExplicitly = true;
  }
  
}
